package com.robot.merchant.client;

import com.robot.merchant.client.impl.LogClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author lin
 */
@Component
@FeignClient(value = "robot-log", fallback = LogClientImpl.class)
public interface LogClient {
    /**
     * 根据memberId和keywords查找搜索记录,同一用户搜索相同关键词只记录一次
     *
     * @param memberId
     * @param keywords
     * @return
     */
    @GetMapping(value = "searchLog/third/findSearchLogByMemberIdAndKeywords/{memberId}/{keywords}", produces = "application/json;charset=utf-8")
    public String thirdFindSearchLogByMemberIdAndKeywords(@PathVariable String memberId, @PathVariable String keywords);

    /**
     * 增加搜索
     *
     * @param searchLog
     * @return
     */
    @PostMapping(value = "searchLog/third/addSearchLog", produces = "application/json;charset=utf-8")
    public void thirdAddSearchLog(@RequestBody String searchLog);
}
